include "BaseService.thrift"

namespace cpp imserver
namespace java me.vzhi.groupService

enum GroupType {
  GROUP_TYPE_JOB_POSITION = 1;
  GROUP_TYPE_PROFESSION = 2;
}

enum GroupMemberStatus {
  GROUP_MEMBER_STATUS_QUIT = 0;
  GROUP_MEMBER_STATUS_NORMAL = 1;
  GROUP_MEMBER_STATUS_RESUME_LIKE = 8;
}

const string JOB_GROUP_NAME_PREFIX = "[投递群]"
const string GROUP_JOIN_TEXT_FORMAT = "%s加入了本群"

struct GroupInfo {
  1: required i64 id;
  2: required string name;
  3: required i32 type;
  4: required i64 entity_id;
  5: required i32 member_count;
  6: required set<string> tags;
  7: required i64 create_date;
  8: required string logo;
}

service GroupService extends BaseService.BaseService {
  i64 CreateGroup(1: GroupInfo group_info);
  bool AddGroupTags(1: i64 group_id, 2: set<string> tags);
  bool DelGroupTags(1: i64 group_id, 2: set<string> tags);
  GroupInfo GetGroupInfo(1: i64 group_id);
  GroupInfo GetGroupInfoByEntityId(1: i32 type, i64 entity_id);
  bool UpdateGroupInfo(1: GroupInfo group_info);
  set<i64> GetGroupMemberIds(1: i64 group_id);
  set<i64> GetJoinedGroupIds(1: i64 uid);
  bool JoinInGroup(1: i64 group_id, 2: i64 uid);
  bool QuitFromGroup(1: i64 group_id, 2: i64 uid);
  bool SetMemberStatus(1: i64 group_id, 2: i64 uid, 3: i32 status);
}

